import path = require("path")
import { settings } from "./settings";
import { start as startAdmin } from "maishu-admin";

interface Config {
    port: number, node_modules: string,
    gateway: string,
}
export function start(config: Config) {
    let staticRootDirectory = settings.staticRootDirectory = path.join(__dirname, "../client");
    startAdmin({
        port: config.port,
        staticRootDirectory,
        gateway: config.gateway,
        virtualPaths: {
            lib: path.join(__dirname, "../client/lib"),
            "user/lib": path.join(__dirname, "../client/lib"),
            node_modules: config.node_modules,
            "admin/components": path.join(__dirname, "../client/components"),
            "user/components": path.join(__dirname, "../client/components"),
        },
    })
}